﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Tosi {

    class Var
    {
        public static int JncNumber = 0;
        public static int StrNumber = 0;
        public static double[,] JncArr = null;
        public static string[] JncName = null;
        public static int[,] StrArr = null;
        public static string[] StrName = null;
        public static GraficPlot gr = null;
        public static Junction[] JUNCTIONS = null;
        public static Street[] STREETS = null;
        public static Car[] CARS = null;
        public static Randomiser varRandom = new Randomiser();
        public static Randomiser constRandom = new Randomiser(1);
        public static WriteToExcel excelWriter = new WriteToExcel();

        public static int On = 0;
        public static int Intervals = 10;
        public static int Iterations = 20;
        public static int Delay = 60;
        public static int CarNr = 100;
        public static int CarOffset = 14;
        
        public static int redRule1_ValidCarNr = 4;
        public static int redRule2_ValidLoad = 40;
        public static int greenRule1_ValidCarNr = 4;
        public static int greenRule2_ValidLoad = 40;
        public static int greenRule3_ = 0;
        //public static int NrOfMoves = 350;                          // kirajzolasok szama
        //public static int NrOfIntervals = NrOfMoves / MovesPerInterval;             // intervallumok szama
    
    }


    class Point {
        private double[] pos;

        public Point(double x, double y) {
            pos = new double[2];
            pos[0] = x;
            pos[1] = y;
        }
        public double getX() {
            return pos[0];
        }
        public double getY() {
            return pos[1];
        }
        public void setX(double x) {
            pos[0] = x;
        }
        public void setY(double y) {
            pos[1] = y;
        }
        public void plusX(double x) {
            pos[0] += x;
        }
        public void plusY(double y) {
            pos[1] += y;
        }
        public bool equal(Point who) {
            if ((who.getX() == pos[0]) && (who.getY() == pos[1])) return true;
            else return false;
        }
        public static int operator < (Point p1, Point p2) {
            if (p1.pos[0] == p2.pos[0]){
                if (p1.pos[1] == p2.pos[1]) return 0;
                else if (p1.pos[1] < p2.pos[1]) return 1;
                     else return -1; 
            }
            if (p1.pos[0] < p2.pos[0]) return 1;
            else return -1;
        }
        public static int operator >(Point p1, Point p2) {
            return 1;
        }
        public void setTo(Point p){
            pos[0] = p.pos[0];
            pos[1] = p.pos[1];
        }

    }
   
}

